package com.example.demo.service;

import com.example.demo.mapper.KlassMapper;
import com.example.demo.mode.Klass;
import com.example.demo.repository.KlassRepository;
import com.example.demo.repository.StudentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Component;

@Component
public class KlassService {
    @Autowired
    private KlassMapper klassMapper;
    @Autowired
    private KlassRepository klassRepository;
    public Object finAll(Klass klass)
    {
        return klassRepository.findAll(Example.of(klass));
    }
    public void deleteById(String id)
    {
        klassMapper.deleteById(id);
    }
    public void save(Klass s)
    {
        klassMapper.save(s);
    }
    public Klass getReferenceById(String id)
    {
        return klassMapper.getReferenceById(id);
    }

    public void update(Klass s) {
        klassMapper.update(s);
    }
}
